import 'dart:convert';

import 'package:flutter/services.dart' show rootBundle;

class YSHJsonLoaderManager {
  // 获取首页数据
  static Future<Map<String, dynamic>?> loadJsonData(String path) async {
    // 加载本地json文件
    final String jsonString = await rootBundle.loadString(path);
    // 2.将jsonString转成Map
    final Map<String, dynamic>? result = json.decode(jsonString);
    // 3.返回对应字典
    return result;
  }
}
